package com.feri.rbacsys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.feri.rbacsys.bo.ProductBo;
import com.feri.rbacsys.entity.Product;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (Product)表数据库访问层
 *
 * @author makejava
 * @since 2023-03-27 21:00:21
 */
public interface ProductDao extends BaseMapper<Product> {
    @Select("select tp.id,tp.name,tp.picture,tp.specifications,tp.unit,tp.kind,tp.price,tp.state,tb.name brand_name " +
            "from t_product tp\n" +
            "LEFT JOIN t_brand tb\n" +
            "on tp.brand_id=tb.id")
    List<ProductBo> selectAll();
}

